{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Cybertron</title>
    <link rel="stylesheet" href="{% static 'xadmin/css/bootstrap.min.css' %}">
    <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        body{
            background: url("{% static 'xadmin/img/1.jpg' %}");
            animation-name:myfirst;
            animation-duration:12s;
            /*变换时间*/
            animation-delay:2s;
            /*动画开始时间*/
            animation-iteration-count:infinite;
            /*下一周期循环播放*/
            animation-play-state:running;
            /*动画开始运行*/
        }
        @keyframes myfirst
        {
            0%   {background:url("{% static 'xadmin/img/1.jpg' %}");}
            34%  {background:url("{% static 'xadmin/img/2.jpg' %}");}
            67%  {background:url("{% static 'xadmin/img/3.jpg' %}");}
            100% {background:url("{% static 'xadmin/img/1.jpg' %}");}
        }
        .form{background: rgba(255,255,255,0.2);width:400px;margin:120px auto;}
        /*阴影*/
        .fa{display: inline-block;top: 27px;left: 6px;position: relative;color: #ccc;}
        input[type="text"],input[type="password"]{padding-left:26px;}
        .checkbox{padding-left:21px;}
    </style>
</head>
<body>
    <div class="container">
        <form class="form row" style="width:450px;" method="post" action="">{% csrf_token %}
            <div class="form-horizontal col-md-offset-3" id="login_form" style="margin-left:20%;">
                <h3 class="form-title">LOGIN</h3>
                <div class="col-md-9">
                    <div class="form-group">
                        <i class="fa fa-user fa-lg"></i>
                        <input class="form-control required" type="text" value="{{ username }}" placeholder="Username" id="username" name="username" autofocus="autofocus" maxlength="20"/>
                    </div>
                    <div class="form-group">
                            <i class="fa fa-lock fa-lg"></i>
                            <input class="form-control required" type="password" value="{{ password }}" placeholder="Password" id="password" name="password" maxlength="8"/>
                    </div>
                    <div class="form-group">
                            <!--<i class="fa fa-lock fa-lg"></i>-->
                            <input class="form-control required" type="text" placeholder="验证码" id="vcode" name="vcode" style="width:50%;float:left;"/>
                            <img id="vcode-img" src="{% url 'vcode' %}?" alt="" style="margin-left:20px;">
                            <p style="color:red">{{ error }}</p>
                    </div>
                    <!--<div class="form-group">
                        <label class="checkbox">
                            <input type="checkbox" name="remember" value="1"/>记住我
                        </label>
                    </div>-->

                    <div class="form-group col-md-offset-9">
                        <button type="submit" class="btn btn-success pull-right">登录</button>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <script src="{% static 'xadmin/js/jquery-2.1.1.min.js' %}"></script>
    <script src="{% static 'xadmin/js/bootstrap.min.js' %}"></script>
    <script>
        // 点击验证码图片 刷新验证码
        $("#vcode-img").click(function () {
            $(this)[0].src += "?";
        })
    </script>
</body>
</html>